package com.test01_程序基础;

import org.junit.Test;

/**
 * Java数据类型
 */
public class YootkDemo_02 {

    /**
     * 基本数据类型
     */
    @Test
    public void test1() {
        byte n1 = 10;
        short n2 = 20;
        int n3 = 100;
        long n4 = 20220820L;
        float n5 = 10.10F;
        double n6 = 20.20D;
        char n7 = 'a';
        boolean n8 = false;
        System.out.println(n1);
        System.out.println(n2);
        System.out.println(n3);
        System.out.println(n4);
        System.out.println(n5);
        System.out.println(n6);
        System.out.println(n7);
        System.out.println(n8);
    }

    /**
     * var关键字，JDK10引入
     */
    @Test
    public void test2() {
        {
            var num1 = 10.2;
            var num2 = 3;
            System.out.println(num1 - num2);
            System.out.println(((Object)num1).getClass());
            System.out.println(((Object)num2).getClass());
        }
        {
            var message = "沐言科技：www.yootk.com";
            System.out.println(message);
            System.out.println(message.getClass());
        }
    }
}
